// pages/searchBook/index.js
var app = getApp();
var util = require('../../utils/util.js');
Page({
  data:{
    inputValue:'',
    list:[{
      id:1,
      bookName:'武极天下',
      author:'作者君',
      holder:'小王',
      renter:'小王',
      date:'2016-01-01',
      canRent:true,
    },
    {
      id:2,
      bookName:'武极天下',
      author:'作者君',
      holder:'小王',
      renter:'小王',
      date:'2016-01-01',
      canRent:false,
    }]
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
  
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  inputKey:function(e){
    this.setData({
      inputValue:e.detail.value
    })
    console.log(this.data.inputValue)
  },
  searchBook:function(){
    if(this.data.inputValue){
      util.searchBook(this.data.inputValue);
    }
  },  
  noBook:function(){
    console.log("noBook")
  },
  rentBook:function(){
    console.log('jieshu')
  }
})